/*
 *  CS202 - Spring 2009">
 *  Professor: Dr. Michael Peterson">
 *  Student: Deylo Woo (dwoo711@gmail.com) ">
 */
package project_4;

import javax.swing.*;
import java.awt.event.KeyEvent;
import java.awt.*;
import java.awt.event.KeyListener;

public class GameMain extends JFrame {

    private GamePanel _gamePanel;
    private MenuPanel _menuPanel;

    public GameMain() {
        super("Project 4");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        _gamePanel = new GamePanel();
        this.add(_gamePanel, BorderLayout.CENTER);
        
        _menuPanel = new MenuPanel();
        this.add(_menuPanel, BorderLayout.EAST);
        _menuPanel.setScore("zero scores");
        
        setSize(1000, 500);
        setVisible(true);
        center(this);

        while(true){
            
        }

    }

    public static void center(JFrame frame) {
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        Point center = ge.getCenterPoint();

        int w = frame.getWidth();
        int h = frame.getHeight();

        int x = center.x - w / 2, y = center.y - h / 2;
        frame.setBounds(x, y, w, h);
        frame.validate();
    }

    public static void main(String[] args) {

        GameMain _game = new GameMain();

    }
}
